<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String path = request.getContextPath();
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

	<title>订单管理</title>

	<link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
	<link href="../AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

	<link href="../css/personal.css" rel="stylesheet" type="text/css">
	<link href="../css/orstyle.css" rel="stylesheet" type="text/css">

	<script src="../AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
	<script src="../AmazeUI-2.4.2/assets/js/amazeui.js"></script>
    <script type="text/javascript" src="../js/jquery.js"></script>
	<script language="javascript">
        function upOrder(id)
        {
            //window.alert(sid);
            var c=window.confirm("你是否真的要确认收货?");
            if(c)
            {
                document.location="/user/upOder1?id="+id;
            }
            else
            {
                window.alert("您没有确认收货");
            }
        }
        function updateOrder(id)
        {
            //window.alert(sid);
            var c=window.confirm("你是否真的要取消这条订单?");
            if(c)
            {
                document.location="/user/upOder2?id="+id;
            }
            else
            {
                window.alert("您没有取消订单");
            }
        }
	</script>
</head>

<body>
<!--头 -->
<header>

        <jsp:include page="../front/head.jsp"></jsp:include>

</header>
<div class="nav-table">
	<div class="long-title"><span class="all-goods">全部分类</span></div>
	<div class="nav-cont">
		<ul>
			<li class="index"><a href="#">首页</a></li>
			<li class="qc"><a href="#">闪购</a></li>
			<li class="qc"><a href="#">限时抢</a></li>
			<li class="qc"><a href="#">团购</a></li>
			<li class="qc last"><a href="#">大包装</a></li>
		</ul>
		<div class="nav-extra">
			<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
			<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
		</div>
	</div>
</div>
<b class="line"></b>
<div class="center">
	<div class="col-main">
		<div class="main-wrap">

			<div class="user-order">

				<!--标题 -->
				<div class="am-cf am-padding">
					<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单管理</strong> / <small>Order</small></div>
				</div>
				<hr/>

				<div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

					<ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
						<li class="am-active"><a href="#tab1">所有订单</a></li>
						<li><a href="#tab4">待收货</a></li>
					</ul>

					<div class="am-tabs-bd">
						<div class="am-tab-panel am-fade am-in am-active" id="tab1">
							<div class="order-top">
								<div class="th th-item">
									<td class="td-inner">商品</td>
								</div>
								<div class="th th-price">
									<td class="td-inner">单价</td>
								</div>
								<div class="th th-number">
									<td class="td-inner">数量</td>
								</div>
								<div class="th th-operation">
									<td class="td-inner">商品操作</td>
								</div>
								<div class="th th-amount">
									<td class="td-inner">合计</td>
								</div>
								<div class="th th-status">
									<td class="td-inner">交易状态</td>
								</div>
								<div class="th th-change">
									<td class="td-inner">交易操作</td>
								</div>
							</div>

							<div class="order-main">
								<div class="order-list">
									<c:forEach items="${Order}" var="order" varStatus="status">
										<c:forEach items="${OrderDetail}" var="orderinfo" varStatus="status">
											<c:forEach items="${Product}" var="product" varStatus="status">
												<c:if test="${order.orderNo == orderinfo.orderNo }">
													<c:if test="${order.orderFinishTime != null }">
														<c:if test="${orderinfo.productId == product.productId}">



															<!--交易成功-->
															<div class="order-status5">
																<div class="order-title">
																	<div class="dd-num">订单编号：<a href="javascript:;">${orderinfo.orderNo}</a></div>
																	<span>成交时间：<fmt:formatDate pattern="yyyy-MM-dd hh:mm:dd" value="${order.orderCreatTime}" /></span>
																	<!--    <em>店铺：小桔灯</em>-->
																</div>
																<div class="order-content">
																	<div class="order-left">

																		<ul class="item-list">
																			<li class="td td-item">
																				<div class="item-pic">
																					<a href="#" class="J_MakePoint">
																						<img src="${product.productImage}" class="itempic J_ItemImg">
																					</a>
																				</div>
																				<div class="item-info">
																					<div class="item-basic-info">
																						<a href="#">
																							<p>${orderinfo.productName}</p>
																							<p class="info-little">颜色：12#川南玛瑙
																								<br/>包装：裸装 </p>
																						</a>
																					</div>
																				</div>
																			</li>
																			<li class="td td-price">
																				<div class="item-price">
																						${orderinfo.productTotalprice}
																				</div>
																			</li>
																			<li class="td td-number">
																				<div class="item-number">
																					<span>×</span>${orderinfo.productNumber}
																				</div>
																			</li>
																			<li class="td td-operation">
																				<div class="item-operation">

																				</div>
																			</li>
																		</ul>
																	</div>
																	<div class="order-right">
																		<li class="td td-amount">
																			<div class="item-amount">
																					${orderinfo.productTotalprice}
																			</div>
																		</li>
																		<div class="move-right">
																			<li class="td td-status">
																				<div class="item-status">
																					<p class="Mystatus">交易成功</p>
																					<p class="order-info"><a href="orderinfo.jsp">订单详情</a></p>
																					<p class="order-info"><a href="logistics.jsp">查看物流</a></p>
																				</div>
																			</li>
																			<li class="td td-change">
																				<div class="am-btn am-btn-danger anniu">
																					订单已完成</div>
																			</li>
																		</div>
																	</div>
																</div>
															</div>
														</c:if>

													</c:if>
													<c:if test="${order.orderFinishTime == null}" >
														<c:if test="${order.orderCancelTime == null}">
															<c:if test="${orderinfo.productId == product.productId}">
																<!--不同状态订单-->
																<div class="order-status3">
																	<div class="order-title">
																		<div class="dd-num">订单编号：<a href="javascript:;">${orderinfo.orderNo}</a></div>
																		<span>成交时间：<fmt:formatDate pattern="yyyy-MM-dd hh:mm:dd" value="${order.orderCreatTime}" /></span>
																		<!--    <em>店铺：小桔灯</em>-->
																	</div>
																	<div class="order-content">
																		<div class="order-left">
																			<ul class="item-list">
																				<li class="td td-item">
																					<div class="item-pic">
																						<a href="#" class="J_MakePoint">
																							<img src="${product.productImage}" class="itempic J_ItemImg">
																						</a>
																					</div>
																					<div class="item-info">
																						<div class="item-basic-info">
																							<a href="#">
																								<p>${orderinfo.productName}</p>
																								<%--<p class="info-little">颜色：12#川南玛瑙
																									<br/>包装：裸装 </p>
																							</a>--%>
																						</div>
																					</div>
																				</li>
																				<li class="td td-price">
																					<div class="item-price">
																							${orderinfo.productTotalprice}
																					</div>
																				</li>
																				<li class="td td-number">
																					<div class="item-number">
																						<span>×</span>${orderinfo.productNumber}
																					</div>
																				</li>
																				<li class="td td-operation">
																					<div class="item-operation">
																						<a href="refund.jsp">退款/退货</a>
																					</div>
																				</li>
																			</ul>

																		</div>
																		<div class="order-right">
																			<li class="td td-amount">
																				<div class="item-amount">
																					合计：${orderinfo.productTotalprice}
																				</div>
																			</li>
																			<div class="move-right">
																				<li class="td td-status">
																					<div class="item-status">
																						<p class="Mystatus">卖家已发货</p>
																						<p class="order-info"><a href="orderinfo.jsp">订单详情</a></p>
																						<p class="order-info"><a href="logistics.jsp">查看物流</a></p>
																						<p class="order-info"><a href="#">延长收货</a></p>
																					</div>
																				</li>
																				<li class="td td-change">
																					<div class="am-btn am-btn-danger anniu" onclick="upOrder(${order.orderId})">
																						确认收货</div>
																					<div class="am-btn am-btn-danger anniu" onclick="updateOrder(${order.orderId})">
																						取消订单</div>
																				</li>
																			</div>
																		</div>
																	</div>

																</div>
															</c:if>
														</c:if>
													</c:if>
													<c:if test="${order.orderFinishTime == null}" >
														<c:if test="${order.orderCancelTime != null}" >
															<c:if test="${orderinfo.productId == product.productId}">
																<!--不同状态订单-->
																<div class="order-status3">
																	<div class="order-title">
																		<div class="dd-num">订单编号：<a href="javascript:;">${orderinfo.orderNo}</a></div>
																		<span>成交时间：<fmt:formatDate pattern="yyyy-MM-dd hh:mm:dd" value="${order.orderCreatTime}" /></span>
																		<!--    <em>店铺：小桔灯</em>-->
																	</div>
																	<div class="order-content">
																		<div class="order-left">
																			<ul class="item-list">
																				<li class="td td-item">
																					<div class="item-pic">
																						<a href="#" class="J_MakePoint">
																							<img src="${product.productImage}" class="itempic J_ItemImg">
																						</a>
																					</div>
																					<div class="item-info">
																						<div class="item-basic-info">
																							<a href="#">
																								<p>${orderinfo.productName}</p>
																								<p class="info-little">颜色：12#川南玛瑙
																									<br/>包装：裸装 </p>
																							</a>
																						</div>
																					</div>
																				</li>
																				<li class="td td-price">
																					<div class="item-price">
																							${orderinfo.productTotalprice}
																					</div>
																				</li>
																				<li class="td td-number">
																					<div class="item-number">
																						<span>×</span>${orderinfo.productNumber}
																					</div>
																				</li>
																				<li class="td td-operation">
																					<div class="item-operation">
																						<a href="refund.jsp">退款/退货</a>
																					</div>
																				</li>
																			</ul>

																		</div>
																		<div class="order-right">
																			<li class="td td-amount">
																				<div class="item-amount">
																					合计：${orderinfo.productTotalprice}
																				</div>
																			</li>
																			<div class="move-right">
																				<li class="td td-status">
																					<div class="item-status">
																						<p class="Mystatus">卖家已发货</p>
																						<p class="order-info"><a href="orderinfo.jsp">订单详情</a></p>
																						<p class="order-info"><a href="logistics.jsp">查看物流</a></p>
																						<p class="order-info"><a href="#">延长收货</a></p>
																					</div>
																				</li>
																				<li class="td td-change">
																					<div class="am-btn am-btn-danger anniu" >
																						订单已取消</div>

																				</li>
																			</div>
																		</div>
																	</div>

																</div>
															</c:if>
														</c:if>
													</c:if>
												</c:if>
											</c:forEach>
										</c:forEach>
									</c:forEach>
								</div>

							</div>

						</div>
						<div class="am-tab-panel am-fade" id="tab4">
							<div class="order-top">
								<div class="th th-item">
									<td class="td-inner">商品</td>
								</div>
								<div class="th th-price">
									<td class="td-inner">单价</td>
								</div>
								<div class="th th-number">
									<td class="td-inner">数量</td>
								</div>
								<div class="th th-operation">
									<td class="td-inner">商品操作</td>
								</div>
								<div class="th th-amount">
									<td class="td-inner">合计</td>
								</div>
								<div class="th th-status">
									<td class="td-inner">交易状态</td>
								</div>
								<div class="th th-change">
									<td class="td-inner">交易操作</td>
								</div>
							</div>

							<div class="order-main">
								<c:forEach items="${Order}" var="order" varStatus="status">
									<c:forEach items="${OrderDetail}" var="orderinfo" varStatus="status">
										<c:forEach items="${Product}" var="product" varStatus="status">
											<c:if test="${order.orderNo == orderinfo.orderNo }">
											<c:if test="${order.orderFinishTime == null}" >
												<c:if test="${order.orderCancelTime == null}">
													<c:if test="${orderinfo.productId == product.productId}">

														<div class="order-list">
															<div class="order-status3">
																<div class="order-title">
																	<div class="dd-num">订单编号：<a href="javascript:;">${orderinfo.orderNo}</a></div>
																	<span>成交时间：<fmt:formatDate pattern="yyyy-MM-dd hh:mm:dd" value="${order.orderCreatTime}" /></span>
																	<!--    <em>店铺：小桔灯</em>-->
																</div>
																<div class="order-content">
																	<div class="order-left">
																		<ul class="item-list">
																			<li class="td td-item">
																				<div class="item-pic">
																					<a href="#" class="J_MakePoint">
																						<img src="${product.productImage}" class="itempic J_ItemImg">
																					</a>
																				</div>
																				<div class="item-info">
																					<div class="item-basic-info">
																						<a href="#">
																							<p>${orderinfo.productName}</p>
																							<p class="info-little">颜色：12#川南玛瑙
																								<br/>包装：裸装 </p>
																						</a>
																					</div>
																				</div>
																			</li>
																			<li class="td td-price">
																				<div class="item-price">
																						${orderinfo.productTotalprice}
																				</div>
																			</li>
																			<li class="td td-number">
																				<div class="item-number">
																					<span>×</span>${orderinfo.productNumber}
																				</div>
																			</li>
																			<li class="td td-operation">
																				<div class="item-operation">
																				</div>
																			</li>
																		</ul>


																	</div>
																	<div class="order-right">
																		<li class="td td-amount">
																			<div class="item-amount">
																					${orderinfo.productTotalprice}
																			</div>
																		</li>
																		<div class="move-right">
																			<li class="td td-status">
																				<div class="item-status">
																					<p class="Mystatus">卖家已发货</p>
																					<p class="order-info"><a href="orderinfo.jsp">订单详情</a></p>
																					<p class="order-info"><a href="logistics.jsp">查看物流</a></p>
																				</div>
																			</li>
																			<li class="td td-change">
																				<div class="am-btn am-btn-danger anniu" onclick="upOrder(${order.orderId})">
																					确认收货</div>
																			</li>
																		</div>
																	</div>
																</div>
															</div>
														</div>
													</c:if>
												</c:if>
											</c:if>
											</c:if>
										</c:forEach>
									</c:forEach>
								</c:forEach>
							</div>
						</div>
					</div>

				</div>
			</div>
		</div>
		<!--底部-->
		<jsp:include page="../front/footer.jsp"></jsp:include>
	</div>
	<aside class="menu">
		<ul>
			<li class="person">
				<a href="#">个人中心</a>
			</li>
			<li class="person">
				<a href="#">个人资料</a>
				<ul>
					<li> <a href="/user/information">个人信息</a></li>
					<li> <a href="#">安全设置</a></li>
					<li> <a href="/user/address">收货地址</a></li>
				</ul>
			</li>
			<li class="person">
				<a href="#">我的交易</a>
				<ul>
					<li class="active"><a href="/user/order">订单管理</a></li>
					<li> <a href="#">退款售后</a></li>
				</ul>
			</li>
			<li class="person">
				<a href="#">我的资产</a>
				<ul>
					<li> <a href="#">优惠券 </a></li>
					<li> <a href="#">红包</a></li>
					<li> <a href="#">账单明细</a></li>
				</ul>
			</li>

			<li class="person">
				<a href="#">我的小窝</a>
				<ul>
					<li> <a href="#">收藏</a></li>
					<li> <a href="#">足迹</a></li>
					<li> <a href="#">评价</a></li>
					<li> <a href="#">消息</a></li>
				</ul>
			</li>

		</ul>

	</aside>
</div>

</body>

</html>